﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EstimateLib;
using System.Threading;

namespace TestingApp
{
    class Program
    {

        static void AddThread()
        {
            while (true)
            {
                using (Entities entites = new Entities())
                {
                    entites.AddToQuotes(new Quote() { Price = 1, Ticket = "TST", Time = DateTime.Now });
                    entites.SaveChanges();
                }
            }
        }

        static void GetThread()
        {
            while (true)
            {
                using (Entities entites = new Entities())
                {
                    Console.WriteLine(entites.Quotes.ToList().Count);
                }
            }
        }

        static void Main(string[] args)
        {
            Thread add = new Thread(AddThread);
            Thread get = new Thread(GetThread);
            add.Start();
            get.Start();
        }
    }
}
